-
Notifications
You must be signed in to change notification settings - Fork 112
(PoC) Databricks Labs command group
#637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Allow for `labs.yml` definition in target repositories:
```
---
name: dbx
context: workspace
description: Databricks CLI extensions
hooks:
install: install.py
entrypoint: main.py
commands:
- name: foo
description: foo command
flags:
- name: first
description: first flag description
- name: second
description: second flag description
- name: bar
description: bar command
flags:
- name: first
description: first flag description
- name: second
description: second flag description
```
and simple command entry points that are aware of both CLI flags and Unified Authentication env variables:
```
import os, sys, json
print(f'host is {os.environ["DATABRICKS_HOST"]}')
payload = json.loads(sys.argv[1])
print(f'[{payload["command"]}]: flags are {payload["flags"]}')
answer = input('What is your name? ')
print(f'got answer: {answer}')
answer = input('Preferences? ')
print(f'got answer: {answer}')
```
nfx
added a commit
to databrickslabs/dbx
that referenced
this pull request
Aug 7, 2023
See databricks/cli#637 for more context
Collaborator
Author
|
TODO: add |
This was referenced Sep 25, 2023
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 27, 2023
## Changes This PR adds higher-level wrappers for calling subprocesses. One of the steps to get #637 in, as previously discussed. The reason to add `process.Forwarded()` is to proxy Python's `input()` calls from a child process seamlessly. Another use-case is plugging in `less` as a pager for the list results. ## Tests `make test`
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 3, 2023
This PR adds a few utilities related to Python interpreter detection:
- `python.DetectInterpreters` to detect all Python versions available in
`$PATH` by executing every matched binary name with `--version` flag.
- `python.DetectVirtualEnvPath` to detect if there's any child virtual
environment in `src` directory
- `python.DetectExecutable` to detect if there's python3 installed
either by `which python3` command or by calling
`python.DetectInterpreters().AtLeast("v3.8")`
To be merged after #804, as one of
the steps to get #637 in, as
previously discussed.
hectorcast-db
pushed a commit
that referenced
this pull request
Oct 13, 2023
## Changes This PR adds higher-level wrappers for calling subprocesses. One of the steps to get #637 in, as previously discussed. The reason to add `process.Forwarded()` is to proxy Python's `input()` calls from a child process seamlessly. Another use-case is plugging in `less` as a pager for the list results. ## Tests `make test`
hectorcast-db
pushed a commit
that referenced
this pull request
Oct 13, 2023
This PR adds a few utilities related to Python interpreter detection:
- `python.DetectInterpreters` to detect all Python versions available in
`$PATH` by executing every matched binary name with `--version` flag.
- `python.DetectVirtualEnvPath` to detect if there's any child virtual
environment in `src` directory
- `python.DetectExecutable` to detect if there's python3 installed
either by `which python3` command or by calling
`python.DetectInterpreters().AtLeast("v3.8")`
To be merged after #804, as one of
the steps to get #637 in, as
previously discussed.
Collaborator
Author
|
Fixed in #914 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow for
labs.ymldefinition in target repositories:and simple command entry points that are aware of both CLI flags and Unified Authentication env variables:
Changes
Tests